import request from "@/utils/request";

const CUSTOMERFEEDBACK_BASE_URL = "/api/v1/customer-feedback";

const CustomerFeedbackAPI = {
  /** 获取评价反馈分页数据 */
  getPage(queryParams) {
    return request({
      url: `${CUSTOMERFEEDBACK_BASE_URL}/page`,
      method: "get",
      params: queryParams,
    });
  },

  /** 获取评价反馈表单数据 */
  getFormData(id) {
    return request({
      url: `${CUSTOMERFEEDBACK_BASE_URL}/${id}/form`,
      method: "get",
    });
  },

  /** 添加评价反馈 */
  add(data) {
    return request({
      url: `${CUSTOMERFEEDBACK_BASE_URL}`,
      method: "post",
      data: data,
    });
  },

  /** 更新评价反馈 */
  update(id, data) {
    return request({
      url: `${CUSTOMERFEEDBACK_BASE_URL}/${id}`,
      method: "put",
      data: data,
    });
  },

  /** 批量删除评价反馈，多个以英文逗号(,)分割 */
  deleteByIds(ids) {
    return request({
      url: `${CUSTOMERFEEDBACK_BASE_URL}/${ids}`,
      method: "delete",
    });
  },
};

export default CustomerFeedbackAPI;
